import datetime

import numpy as np
import pandas as pd
import streamlit as st


@st.fragment
def part1():
    st.write("part1")
    st.write(datetime.datetime.now())
    st.button('Update Datetime')
    # st.rerun(scope="fragment")


@st.fragment
def part2():
    x = np.random.randn(10_000)
    y = np.random.randn(10_000)
    df = pd.DataFrame({'x': x, 'y': y})
    st.write("part2")
    st.line_chart(df, x='x', y='y')

part1()
part2()


